package com.function;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;

/**
 * 测试生成真实ip
 */
public class GetRealLocation {

    public static void main(String[] args) throws IOException {
        URL url = new URL("https://myip.tool.hengj.cn/");
        BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
        String realIp = br.readLine().trim();
        br.close();
        System.out.println(realIp);
    }

}
